﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

using GPTAS.Infrastructure;

namespace GPTAS.Core
{
    public class Configuration
    {
        private static readonly Configuration _instance = new Configuration();

        private Configuration()
        {

        }

        public static Configuration Instance
        {
            get { return _instance; }
        }

        public int NumberofGroups
        {
            get;
            set;
        }

        public int NumberofResults
        {
            get;
            set;
        }
                
        public Dictionary<int,Constraint> Constraints
        {
            get;
            set;
        }

        public string ImportPath
        {
            get;
            set;
        }

        public string ResultPath
        {
            get;
            set;
        }

        public string DatabasePath
        {
            get;
            set;
        }

        public String DatabaseName
        {
            get;
            set;
        }

        public void Configure()
        {
            try
            {
                NumberofGroups = Convert.ToInt32(ConfigurationManager.AppSettings["NumberofGroups"]);
                NumberofResults = Convert.ToInt32(ConfigurationManager.AppSettings["NumberofResults"]);
                ImportPath = ConfigurationManager.AppSettings["ImportPath"];
                ResultPath = ConfigurationManager.AppSettings["ResultPath"];
                DatabasePath = ConfigurationManager.AppSettings["DatabasePath"];
                DatabaseName = ConfigurationManager.AppSettings["DatabaseName"];
            }
            catch (Exception exc)
            {
                
            }
        }
        
    }
}
